﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using UnityEngine;

namespace Assets.Script
{
    public class ConFigManager : Singleton<ConFigManager>
    {
        internal void LoadJson()
        {
            GameDataSprite.Ins.additionDatas = JsonConvert.DeserializeObject<List<AdditionData>>(Resources.Load<TextAsset>("Json/AdditionData").text);
            GameDataSprite.Ins.advertisingDatas = JsonConvert.DeserializeObject<List<AdvertisingData>>(Resources.Load<TextAsset>("Json/AdvertisingData").text);
            GameDataSprite.Ins.allSkinDatas = JsonConvert.DeserializeObject<Dictionary<int, List<SkinData>>>(Resources.Load<TextAsset>("Json/SkinData").text);
            GameDataSprite.Ins.snakeDatas = JsonConvert.DeserializeObject<List<SnakeData>>(Resources.Load<TextAsset>("Json/SnakeData").text);
            GameDataSprite.Ins.jiesuoSkinDatas = JsonConvert.DeserializeObject<List<JiesuoSkinData>>(Resources.Load<TextAsset>("Json/JiesuoSkinData").text);
        }
    }
}
